package top.huxy.boot.model.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author huxy
 * @date 2021-09-25
 **/
@Data
@NoArgsConstructor
public class OperationLog implements Serializable {

    private Integer id;

    /**
     * 操作名
     **/
    private String name;

    /**
     * 执行的方法签名
     **/
    private String method;

    /**
     * 请求id，没有则无
     **/
    private String requestId;

    /**
     * 执行消耗时间
     **/
    private Integer time;

    /**
     * 方法状态，是否抛异常。1表示正常
     **/
    private Boolean status;

    /**
     * 如果有，这里是管理员的id
     **/
    private Integer adminId;

    /**
     * 如果有，这是是用户id
     **/
    private String userId;

    private long createTime;

    public OperationLog(String name, String method, String requestId, Integer time, Boolean status, Integer adminId, String userId, long createTime) {
        this.name = name;
        this.method = method;
        this.requestId = requestId;
        this.time = time;
        this.status = status;
        this.adminId = adminId;
        this.userId = userId;
        this.createTime = createTime;
    }
}
